From: Florian Müllner Date: Fri, 30 Sep 2011 22:33:36 +0000 (+0200) Subject: contact-display: Try harder to display a meaningful name X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7494 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0d5618fdd1dd30d7594aa450d46ed91df43f8f24;p=gnome-shell.git contact-display: Try harder to display a meaningful name We now match individuals on other properties than alias, so take this into account when representing a contact in search results to avoid having them show up as "Unknown". https://bugzilla.gnome.org/show_bug.cgi?id=660580 --- diff --git a/js/ui/contactDisplay.js b/js/ui/contactDisplay.js index 10048af68..8cc46e03f 100644 --- a/js/ui/contactDisplay.js +++ b/js/ui/contactDisplay.js @@ -26,7 +26,8 @@ function Contact(id) { Contact.prototype = { _init: function(id) { - this.individual = Shell.ContactSystem.get_default().get_individual(id); + this._contactSys = Shell.ContactSystem.get_default(); + this.individual = this._contactSys.get_individual(id); this.actor = new St.Bin({ style_class: 'contact', reactive: true, @@ -56,7 +57,12 @@ Contact.prototype = { x_align: St.Align.START, y_align: St.Align.MIDDLE }); - let aliasText = this.individual.alias || _("Unknown"); + let email = this._contactSys.get_email_for_display(this.individual); + let aliasText = this.individual.alias || + this.individual.full_name || + this.individual.nickname || + email || + _("Unknown"); let aliasLabel = new St.Label({ text: aliasText, style_class: 'contact-details-alias' }); details.add(aliasLabel, { x_fill: true,